<div id="slide_list">
<% @slideshow.slideshow_images(true).each_with_index do |@slideshow_image, i| -%>

<%= image_tag(url_for_file_column('slideshow_image', 'image_url', 'thumb'), :id=>"img_#{i}", :class=>"sortable_slide_image") %>

<% end -%>
</div>
<p style="text-align: right">
<a href="#" onclick="new Ajax.Updater('image_list', '/slideshows/reorder/<%=@slideshow.id%>', {asynchronous:true, evalScripts:true, parameters:Sortable.serialize('slide_list')}); return false;">
Done</a>
<%= link_to_remote 'Cancel', :update => 'image_list', 
:after => "insertWaitingImg('image_list')",
:url => {:controller => 'slideshows', :action => 'cancel_reorder', :id => @slideshow }%>
</p>

<script type="text/javascript" language="javascript">
 // <![CDATA[
   Sortable.create("slide_list",
     {tag:'img',overlap:'horizontal',constraint:false}
   );
 // ]]>
 </script>